scsi: hisi_sas: Fix the race between IO completion and timeout for SMP/internal IO
authorXiang Chen <chenxiang66@hisilicon.com>
Mon, 24 Sep 2018 15:06:30 +0000 (23:06 +0800)
committerSalvatore Bonaccorso <carnil@debian.org>
Thu, 18 Jul 2019 22:23:17 +0000 (23:23 +0100)
commitd6af75af205bc26d6079461580850a615b75537d
treef87de6e08e40360e2ecb648175409b1fb8155f17
parent2d75fd7fd1074e7331aa2382bbdb8970d0709aab
scsi: hisi_sas: Fix the race between IO completion and timeout for SMP/internal IO

If SMP/internal IO times out, we will possibly free the task immediately.

However if the IO actually completes at the same time, the IO completion
may refer to task which has been freed.

So to solve the issue, flush the tasklet to finish IO completion before
free'ing slot/task.

Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com>
Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Gbp-Pq: Topic bugfix/arm64/huawei-taishan
Gbp-Pq: Name 0003-scsi-hisi_sas-Fix-the-race-between-IO-completion-and.patch
drivers/scsi/hisi_sas/hisi_sas_main.c